import Cookies from 'js-cookie'

const TokenKey = 'hrsaas-ihrm-token'

// 取
export function getToken () {
  return Cookies.get(TokenKey)
}

// 存
export function setToken (token) {
  Cookies.set(TokenKey, token)
}

// 删
export function removeToken () {
  Cookies.remove(TokenKey)
}

const tokenTime = 'token-time'

// 设置时间戳
export function setTimeStamp () {
  Cookies.set(tokenTime, Date.now())
}

// 取事件戳
export function getTimeStamp () {
  return Cookies.get(tokenTime)
}
